<template>
    <h1>案例翻转字符串</h1>
    <h3>{{ msg }}</h3>
    <button @click="btn">点击翻转字符</button>
</template>

<script setup>
import { ref } from 'vue';
const msg = ref("hello vue3");
const btn = () => {
    console.log("点击了");

    console.log(msg.value.split('').reverse().join(''));
    msg.value = msg.value.split('').reverse().join('')
}

</script>

<style scoped></style>